import flash.events.Event;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.geom.Matrix;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;

import CustomSprite;
import Button;
import Images;

class WorkCoMenuEvent extends Event{
	public function new(customEventString:String){

	super(customEventString, true, false);

    }
}

class WorkCoMenu extends GenericMenu
{
public var FindJob:Button;
public var Description:TextField;
private var currentDescription:String;
     public function new(inBackground:BitmapData) {
     super(inBackground);
  Description = new TextField();
  currentDescription = "Here is where you Find a new Job.";
  Description.htmlText= "<font color='#000000' size='16'>"+currentDescription+"</font>";
  Description.wordWrap = true;

  addChild(Description);
  FindJob = new Button(250,50,"Find A Job");
  FindJob.x = 10;
  FindJob.y = 10;
  FindJob.buttonMode = true;
  addChild(FindJob);
  
  FindJob.addEventListener(MouseEvent.MOUSE_OVER, onFindJobOver);
  FindJob.addEventListener(MouseEvent.CLICK, onFindJobClick);
  FindJob.addEventListener(MouseEvent.MOUSE_OUT, onFindJobOut);

  var myFormat:TextFormat = new TextFormat();
  //myFormat.size = 15;
  Description.autoSize = TextFieldAutoSize.CENTER;
  //Turning off for now
  Description.x = 405;
  Description.y = (height-32) / 2 + 100;
  Description.width=230;
  
  
  Description.selectable = false;
  Description.mouseEnabled = false;


  }
private function onFindJobClick(event:MouseEvent){
  dispatchEvent(new WorkCoMenuEvent("FindJob"));
}
private function onFindJobOver(event:MouseEvent) {
 Description.htmlText= "<font color='#000000' size='16'>"+"Find A Job. Shortkey F"+"</font>";
}

private function onFindJobOut(event:MouseEvent) {
 Description.htmlText= "<font color='#000000' size='16'>"+currentDescription+"</font>";
}
}